package com.kcs.fxmargin.service;

import java.sql.Connection;

import org.apache.log4j.Logger;

import com.kcs.common.utils.ConnectionUtils;
import com.kcs.common.utils.Constant;
import com.kcs.fxmargin.bo.ImportDepositWithdrawBO;
import com.kcs.fxmargin.dao.ImportDepositWithdrawDAO;

public class ImportDepositWithdrawService {
	
	private Logger log = Logger.getLogger(Constant.LOG_FX);
	
	public ImportDepositWithdrawBO getImportDWList(ImportDepositWithdrawBO bo)throws Exception{
		Connection conn = null;
		ImportDepositWithdrawDAO dao = null;
		
		log.info("Begin : ImportDepositWithdrawService : getImportDWList");
		
		try{
			
			conn = ConnectionUtils.getConnection(Constant.MSSQL, Constant.TO);
			dao = new ImportDepositWithdrawDAO();
			bo = dao.getImportDWList(bo,conn);
			
		}catch(Exception e){
			throw e;
		}finally{
			if(conn != null){
				try{
					conn.close();
				}catch(Exception ex){
					throw ex;
				}
			}
		}
		
		log.info("End : ImportDepositWithdrawService : getImportDWList");
		return bo;
		
	}
	
	public ImportDepositWithdrawBO getImportDWListDiff(ImportDepositWithdrawBO bo)throws Exception{
		Connection conn = null;
		ImportDepositWithdrawDAO dao = null;
		
		log.info("Begin : ImportDepositWithdrawService : getImportDWListDiff");
		
		try{
			
			conn = ConnectionUtils.getConnection(Constant.MSSQL, Constant.TO);
			dao = new ImportDepositWithdrawDAO();
			bo = dao.getImportDWListDiff(bo,conn);
			
		}catch(Exception e){
			throw e;
		}finally{
			if(conn != null){
				try{
					conn.close();
				}catch(Exception ex){
					throw ex;
				}
			}
		}
		
		log.info("End : ImportDepositWithdrawService : getImportDWListDiff");
		return bo;
		
	}
}
